%
set date british
temporaryfolder=addbs(oprop.appstartpath)+[temp\]
*temporaryfolder=[temp\]
fromdate=orequest.form('datefrom')
todate=orequest.form('dateto')
if isnull(fromdate)
fromdate=NVL(orequest.querystring('datefrom'),'')
endif
if isnull(todate)
todate=NVL(orequest.querystring('dateto'),'')
endif
theaccode=orequest.form('txtcustomer')
if isnull(theaccode)
theaccode=orequest.querystring('ac')
endif
theaccode=transform(theaccode)
set date ymd
pdate1=ctod(fromdate)
pdate2=ctod(todate)
set date british
usesafe('acctran')
usesafe('accounts')
locate for accountid=theaccode
Acname=allt(accountid)+[ ]+allt(name)
if not empty(address1)
acname=acname+[
]+allt(address1)
endif
if not empty(address2)
acname=acname+[
]+allt(address2)
endif
if not empty(phone)
acname=acname+[
Contact: ]+allt(phone)
endif
openingbalancealias=sys(2015)
closingbalancealias=sys(2015)
SELECT [acctran]
SET ORDER TO acdate
=seek(theaccode)
FILEstring=[
| DATE | VTP | TR# | DETAILS | DEBIT | CREDIT | BALANCE |
|---|---|---|---|---|---|---|
| ]+transform(pdate1)+[ | ] glhead=glhead+[]+allt(transform([OPEN]))+[ | ] glhead=glhead+[] glhead=glhead+[ | OPENING BALANCE | ] glhead=glhead+[]+iif(openingbalance>0,TRANSFORM(openingbalance,'999,999,999,999.99'),[ ])+[ | ] glhead=glhead+[]+iif(openingbalance<0,TRANSFORM(abs(openingbalance),'999,999,999,999.99'),[ ])+[ | ] glhead=glhead+[]+TRANSFORM(closingbalance,'999,999,999,999.99')+[ |
| ]+transform(date)+[ | ] glhead=glhead+[]+allt(transform(vtype))+[ | ] glhead=glhead+[]+allt(transform(transid))+[ | ] glhead=glhead+[]+allt(transform(desc))+[ | ] glhead=glhead+[]+iif(debit-credit>0,TRANSFORM(debit-credit,'999,999,999,999.99'),[ ])+[ | ] glhead=glhead+[]+iif(credit-debit>0,TRANSFORM(credit-debit,'999,999,999,999.99'),[ ])+[ | ] glhead=glhead+[]+TRANSFORM(closingbalance,'999,999,999,999.99')+[ |
| BALANCE: | ] glhead=glhead+[]+iif(THEDEBITS>0,TRANSFORM(THEDEBITS,'999,999,999,999.99'),[ ])+[ | ] glhead=glhead+[]+iif(thecredits>0,TRANSFORM(thecredits,'999,999,999,999.99'),[ ])+[ | ] glhead=glhead+[]+TRANSFORM(OVERALL,'999,999,999,999.99')+[ | |||